package com.huike.clues.service.impl;


import com.huike.clues.domain.TbClue;
import com.huike.clues.domain.TbClueTrackRecord;
import com.huike.clues.domain.vo.ClueTrackRecordVo;
import com.huike.clues.mapper.TbClueTrackRecordMapper;
import com.huike.clues.service.ITbClueService;
import com.huike.clues.service.ITbClueTrackRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 线索跟进记录Service业务层处理
 * @date 2022-04-22
 */
@Service
public class TbClueTrackRecordServiceImpl implements ITbClueTrackRecordService {

    @Autowired
    private TbClueTrackRecordMapper tbClueTrackRecordMapper;

    @Autowired
    private ITbClueService iTbClueService;
    /**
     * 根据线索id查询线索跟进记录
     * @param clueId
     * @return
     */
    @Override
    public List<ClueTrackRecordVo> selectByClueId(Long clueId) {
        return tbClueTrackRecordMapper.selectTbClueTrackRecordListByClueId(clueId);
    }

    /**
     * 新建线索跟进
     * @param tbClue
     * @param tbClueTrackRecord1
     */

    @Override
    public void insertTbClueTrackRecord(TbClue tbClue, TbClueTrackRecord tbClueTrackRecord1) {
        //同步修改信息

       iTbClueService.updateTbClue(tbClue);
      //  tbClueTrackRecordMapper.update(tbClue);
        System.out.println("======================"+tbClue.toString());
        //添加修改记录
        tbClueTrackRecordMapper.saveTbClueTrackRecord1(tbClueTrackRecord1);

    }
}
